home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / pc / pb / profile.dir / 00355_Script_355 < prev    next >
Text File  |  1997-07-29  |  10KB  |  211 lines

  1. on xwrapMedia castNameOfMedia, mediaSprite, wrapperSpritesList, bit_rect
  2.   
  3.   --  repeat with qq = 1 to 2
  4.   cursor 4  -- waiting
  5.   --  set winPartsList = [#tlc: "topLeftCorner",#ts: "panelTop", #trc: "topRightCorner", #rs: "rightSide", #brc: "bottomRightCorner", #bs: "panelBottom", #blc: 17, #ls: 18, #topPanelText: 19, #topPanelMask: 20, #closeButton: "closeNormal", #media: 22]
  6.   --[#tlc: "topLeftCorner",#ts: "topSide", #trc: "topRightCorner", #rs: "rightSide", #brc: "bottomRightCorner", #bs: "bottomSide", #blc: 17, #ls: 18, #topPanelText: 19, #topPanelMask: 20, #closeButton: "closeNormal", #media: "??"]
  7.   
  8.   set author = "kfraser@sfu.ca"
  9.   set copyrightHolder = "⌐1995 Gerri Sinclair & SFU ExCITE Centre"
  10.   
  11.   
  12.   -- Initialize
  13.   
  14.   set mediaSpriteOriginH =  the left of sprite mediaSprite
  15.   set mediaSpriteOriginV =  the top of sprite mediaSprite  
  16.   set mediaCastType = the casttype of cast the castNum of sprite mediaSprite
  17.   
  18.   -- =-=-=-= 0th: Media Sprite  MEDIA CAST SIZE HAS TO BE MEDIA SPRITE SIZE
  19.   --    put castNameofMedia
  20.   --  set the castNum of sprite mediaSprite to the number of cast castNameOfMedia
  21.   -- measure the media sprite & store for fast access
  22.   --  set the width of sprite mediaSprite to the width of cast castNameOfMedia
  23.   --  set the height of sprite mediaSprite to the height of cast castNameOfMedia
  24.   --  set mediaCastHeight = the height of cast castNameOfMedia
  25.   --  set mediaCastWidth = the width of cast castNameOfMedia
  26.   --  set the castNum of sprite mediaSprite to the number of cast castNameOfMedia
  27.   --POSITION: the mediasprite 
  28.   --      spriteBox mediaSprite, mediaSpriteOriginH, mediaSpriteOriginV, mediaSpriteOriginH + mediaCastWidth, mediaSpriteOriginV + mediaCastHeight
  29.   --  put "before:" && the regpoint of cast castNameOfMedia -- DEBUG
  30.   --    set the regpoint of cast castNameOfMedia to [locH:mediaCastWidth/2,locV:mediaCastHeight/2]
  31.   --  put "after:" && the regpoint of cast castNameOfMedia -- DEBUG
  32.   
  33.   
  34.   --  set mediaLside = mediaSpriteOriginH
  35.   --  set mediaTside = mediaSpriteOriginV
  36.   --  set mediaRside = mediaSpriteOriginH + mediaCastWidth
  37.   --  set mediaBside = mediaSpriteOriginV + mediaCastHeight
  38.   --  
  39.   set mediaLside = the left of bit_rect
  40.   set mediaTside = the top of bit_rect
  41.   set mediaRside = the right of bit_rect
  42.   set mediaBside = the bottom of bit_rect
  43.   
  44.   set theMediaSpriteHeight = mediaBside - mediaTside
  45.   
  46.   -- set up the close button
  47.   --    set theCloseButtonHeight = the height of cast "closeNormal"
  48.   set theCloseButtonHeight = the height of cast "over close up"
  49.   --    set theCloseButtonHeight = the width of cast "closeNormal"
  50.   set theCloseButtonWidth = the width of cast "over close up"
  51.   -- lapTime("Initialization") -- DEBUG
  52.   
  53.   -- =-=-=-= 1st: Sprite 2: Top
  54.   
  55.   if #digitalVideo = mediaCastType then
  56.     set currentSpriteNumber = getAt(wrapperSpritesList,2) 
  57.     --      set maskSpriteNumber = getAt(wrapperSpritesList,10)
  58.     --      set textLabelSpriteNumber = getAt(wrapperSpritesList,9)
  59.     
  60.     set pauseButtonSpriteNum = getAt(wrapperSpritesList,9)
  61.     set moreButtonSpriteNum = getAt(wrapperSpritesList,10)
  62.   end if
  63.   
  64.   if #bitmap = mediaCastType then     
  65.     set currentSpriteNumber = getAt(wrapperSpritesList,2) 
  66.     --      set maskSpriteNumber = getAt(wrapperSpritesList,10)
  67.     --      set textLabelSpriteNumber = getAt(wrapperSpritesList,9)
  68.     set pauseButtonSpriteNum = getAt(wrapperSpritesList,9)
  69.     set moreButtonSpriteNum = getAt(wrapperSpritesList,10)
  70.   end if
  71.   
  72.   
  73.   set closeButtonSpriteNumber = getAt(wrapperSpritesList,11)
  74.   
  75.   --  convert to property list: getProp(wrapperSpritesList, #maskSprite)
  76.   
  77.   set textVoffset = 0 -- down from top of close button
  78.   -- height of top panel - height of close button / 2  
  79.   set textHoffset = 2 -- in from side of close button
  80.   
  81.   -- height of top panel - textVoffset
  82.   set castNameOfSpriteToMove = the name of cast the castnum of sprite currentSpriteNumber
  83.   
  84.   set currentCastHeight = the height of cast castNameOfSpriteToMove  
  85.   
  86.   -- POSITION: top side sprite
  87.   spriteBox currentSpriteNumber, mediaLside, mediaTside-currentCastHeight, mediaRside, mediaTside
  88.   
  89.   -- POSITION: mask sprite
  90.   --    spriteBox maskSpriteNumber, mediaLside, mediaTside-currentCastHeight, mediaRside, mediaTside
  91.   
  92.   -- POSITION: more button sprite
  93.   set moreHoffset = 2
  94.   set moreVoffset = 2
  95.   set morebwidth = the width of sprite moreButtonSpriteNum
  96.   set morebheight = the height of sprite moreButtonSpriteNum
  97.   spriteBox moreButtonSpriteNum, mediaRside-moreHoffset-morebwidth, mediaBside-moreVoffset-morebheight, mediaRside-moreHoffset, mediaBside-moreVoffset
  98.   
  99.   -- POSITION: rewind button sprite
  100.   set rewButtonSpriteNum = 43
  101.   set pauseHoffset = 2
  102.   set pauseVoffset = -38
  103.   set pausebwidth = the width of sprite rewButtonSpriteNum
  104.   set pausebheight = the height of sprite rewButtonSpriteNum
  105.   spriteBox rewButtonSpriteNum mediaLside+pauseHoffset,mediaBside + pauseVoffset, mediaLside+pauseHoffset+pausebwidth,mediaBside+pauseVoffset+pausebheight
  106.   
  107.   --POSITION: pause button
  108.   set pauseHoffset = 18
  109.   set pauseVoffset = -38
  110.   set pausebwidth = the width of sprite pauseButtonSpriteNum
  111.   set pausebheight = the height of sprite pauseButtonSpriteNum
  112.   spriteBox pauseButtonSpriteNum mediaLside+pauseHoffset,mediaBside + pauseVoffset, mediaLside+pauseHoffset+pausebwidth,mediaBside+pauseVoffset+pausebheight
  113.   
  114.   
  115.   -- POSITION: close button sprite
  116.   set closeBtnVoffset = -15 -- down from top of close button
  117.   
  118.   -- height of top panel - height of close button / 2
  119.   
  120.   set closeBtnHoffset = 0 -- in from side of close button
  121.   
  122.   spriteBox closeButtonSpriteNumber, mediaLside + closeBtnHoffset, mediaTside - theCloseButtonHeight-closeBtnVoffset, mediaLside + theCloseButtonWidth + closeBtnHoffset, mediaTside - closeBtnVoffset
  123.   
  124.   set topPanelHeight = currentCastHeight
  125.   
  126.   set totalHeight = theMediaSpriteHeight + currentCastHeight
  127.   -- lapTime("Top Panel") -- DEBUG
  128.   
  129.   -- =-=-=-= 2nd: Sprite 6: Bottom Panel
  130.   set currentSpriteNumber = getAt(wrapperSpritesList,6)
  131.   set castNameOfSpriteToMove = the name of cast the castnum of sprite currentSpriteNumber
  132.   set currentCastHeight = the height of cast castNameOfSpriteToMove  
  133.   spriteBox currentSpriteNumber, mediaLside, mediaBside, mediaRside, mediaBside + the height of cast castNameOfSpriteToMove
  134.   
  135.   set totalHeight = totalHeight + currentCastHeight
  136.   set bottomPanelHeight = currentCastHeight
  137.   -- lapTime("Bottom Panel")  -- DEBUG  
  138.   
  139.   -- =-=-=-= 3rd: Sprite 1: Top Left Corner
  140.   set currentSpriteNumber = getAt(wrapperSpritesList,1)
  141.   set castNameOfSpriteToMove = the name of cast the castnum of sprite currentSpriteNumber
  142.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  143.   set currentCastHeight = the height of cast castNameOfSpriteToMove
  144.   set tLcHeight = currentCastHeight
  145.   set tLcWidth = currentCastWidth
  146.   spriteBox currentSpriteNumber, mediaLside-currentCastWidth, mediaTside-topPanelHeight, mediaLside, mediaTside - topPanelHeight + currentCastHeight
  147.   
  148.   
  149.   
  150.   -- lapTime("Top Left Corner")  -- DEBUG  
  151.   
  152.   -- =-=-=-= 4th: Sprite 3: Top Right Corner
  153.   set currentSpriteNumber = getAt(wrapperSpritesList,3)
  154.   set castNameOfSpriteToMove = the name of cast the castnum of sprite currentSpriteNumber
  155.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  156.   set currentCastHeight = the height of cast castNameOfSpriteToMove
  157.   set tRcHeight = currentCastHeight
  158.   set tRcWidth = currentCastWidth
  159.   spriteBox currentSpriteNumber, mediaRside, mediaTside - topPanelHeight, mediaRside+currentCastWidth, mediaTside-topPanelHeight + currentCastHeight
  160.   
  161.   
  162.   -- lapTime("Top Right Corner")  -- DEBUG  
  163.   
  164.   -- =-=-=-= 5th: Sprite 5: Bottom Right Corner
  165.   set currentSpriteNumber = getAt(wrapperSpritesList,5)
  166.   set castNameOfSpriteToMove = the name of cast the castnum of sprite getAt(wrapperSpritesList,5)
  167.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  168.   set currentCastHeight = the height of cast castNameOfSpriteToMove
  169.   set bRcHeight = currentCastHeight
  170.   set bRcWidth = currentCastWidth
  171.   spriteBox currentSpriteNumber, mediaRside, mediaBside + bottomPanelHeight - currentCastHeight, mediaRside+currentCastWidth, mediaBside+bottomPanelHeight
  172.   
  173.   
  174.   -- lapTime("Bottom Right Corner")  -- DEBUG  
  175.   
  176.   -- =-=-=-= 6th: Sprite 7: Bottom Left Corner
  177.   set currentSpriteNumber = getAt(wrapperSpritesList,7)
  178.   set castNameOfSpriteToMove = the name of cast the castnum of sprite getAt(wrapperSpritesList,5)
  179.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  180.   set currentCastHeight = the height of cast castNameOfSpriteToMove
  181.   set bLcHeight = currentCastHeight
  182.   set bLcWidth = currentCastWidth
  183.   spriteBox currentSpriteNumber, mediaLside - currentCastWidth, mediaBside + bottomPanelHeight - currentCastHeight, mediaLside, mediaBside + bottomPanelHeight
  184.   
  185.   
  186.   
  187.   -- lapTime("Bottom Left Corner")  -- DEBUG  
  188.   
  189.   -- =-=-=-= 7th: Sprite 8: Left Side
  190.   set currentSpriteNumber = getAt(wrapperSpritesList,8)
  191.   set castNameOfSpriteToMove = the name of cast the castnum of sprite getAt(wrapperSpritesList,5)
  192.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  193.   set currentCastHeight = the height of cast castNameOfSpriteToMove
  194.   spriteBox currentSpriteNumber, mediaLside - currentCastWidth, mediaTside - topPanelHeight + tLcHeight, mediaLside, mediaBside + bottomPanelHeight - bLcHeight
  195.   
  196.   
  197.   -- lapTime("Left Side")  -- DEBUG  
  198.   
  199.   -- =-=-=-= 8th: Sprite 4: Right Side
  200.   set currentSpriteNumber = getAt(wrapperSpritesList,4)
  201.   set castNameOfSpriteToMove = the name of cast the castnum of sprite getAt(wrapperSpritesList,5)
  202.   set currentCastWidth = the width of cast castNameOfSpriteToMove
  203.   set currentCastHeight = the height of cast castNameOfSpriteToMove  
  204.   spriteBox currentSpriteNumber, mediaRside, mediaTside - topPanelHeight + tRcHeight, mediaRside + currentCastWidth, mediaBside + bottomPanelHeight - bRcHeight
  205.   
  206.   
  207.   cursor -1 -- normal cursor
  208.   updatestage -- debug something wierd about this updatestage
  209.   
  210.   
  211. end